package come.whvc

object Test6 {
    def main(args: Array[String]): Unit = {
      val students = List("Alice:85", "Bob:92", "Charlie:78", "Diana:95", "Eve:88")
      //  val res =students.map(_.split(":")).map(t => (t(0), t(1).toInt))
      var res = students.map { t =>
        val Array(ss,ff) = t.split(":")
        (ss,ff.toInt)
      }
      println(res)
      val res2 = res.filter(_._2 > 90)
      println(res2)
      val sum = res.map(_._2).sum
      val len = res.length * 1.0
      println(s"平均分为${sum/len}")
      val res3 = res.sortBy(-_._2)
      println(res3)

    }
}
